#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#define N 10
void sort(int a[], int n, int m);
int  main()
{
    int a[N] = { 0 };
    int n = 0; 
    int m = 0; 
    int i = 0;
    scanf("%d %d", &n, &m);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    sort(a, n, m);
    for (i = 0; i < n; i++)
        printf("%d ", a[i]);
    printf("\n");
    return 0;
}


void sort(int a[10], int n, int m)
{
    int b = 0;
    int j = 0;
    int tem = 0;
    for (b = 0; b < n; b++)
    {
        scanf("%d", &a[b]);
    }
    for (b = 0; b < m; b++)
    {
        for (j = n-1;j >b; j--)
        {
            if (a[j-1] < a[j])
            {
                tem = a[j];
                a[j] = a[j - 1];
                a[j - 1] = tem;
            }
        }
    }
}



